import {hi} from './m.js';

let a = 10;
console.log(hi);


//noImplicitAny为true时报错
function fn(x, y) {
    return x + y
}


//noImplicitThis为true时报错
/*function fn2() {
    alert(this);
}*/
function fn3(this: Window) {
    alert(this);
}



//strictNullChecks为true时报错
let box1 = document.getElementById("box1");
/*
box1.addEventListener("click", function () {
    alert('hello');
});*/
//正确写法1
/*
if(box1 !==null){
    box1.addEventListener("click", function () {
        alert('hello');
    });
}*/
//正确写法2
box1?.addEventListener("click", function () {
    alert('hello');
});